#ifndef COMBINED_OBJECT_H
#define COMBINED_OBJECT_H

#include <vector>
#include <utility>
#include "object.h"
#include "defines/operation.h"

class CombinedObject : public Object{
    public:
        CombinedObject(int = 0);
        CombinedObject(const CombinedObject&, std::vector<Object *>, int = 0);
        CombinedObject(int, const Material &, int = 0);
        CombinedObject(int, std::vector<Object *>, const Material &, int = 0, bool = false);
        CombinedObject(int, const Vector3D &, const Material &, const Matrix &, const Matrix &, int = 0, bool = false);
        ~CombinedObject();

        void changeOperation(int);
        void deleteObject(Object *);

        unsigned int getObjectsSize() const;
        Object *getObject(unsigned int) const;
        void addObject(Object *);

        void draw(bool, bool = false, const Material & = Material()) const;
        std::vector<Trio> intersection(const Ray &) const;
        void getMinMax(double *, double *, unsigned int) const;

    private:
        std::vector<Object *> objects;
        bool test;

        void calculateCenter();
        unsigned int classify(unsigned int, unsigned int) const;
};

#endif
